﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;

namespace WinFormTest
{
	public partial class Form1 : Form
	{

		public Cursor cursor { get; set; }
		public Form1()
		{
			InitializeComponent();
		}

		private void btnStart_Click(object sender, EventArgs e)
		{
			int x = 10;
			int y = 60;
			for (int i = 0; i < 100; i++)
			{
				Button bt = new Button();
				bt.Text = (i + 1).ToString();
				bt.Name = (i + 1).ToString();
				bt.Width = 35;
				bt.Height = 35;
				bt.Location = new Point(x, y);
				bt.Click += new EventHandler(btnStart_Click);
				x += 36;
				if ((i + 1) % 10 == 0)
				{
					x = 10;
					y += 36;
				}
				Controls.Add(bt);
			}
		}
		Thread G_th = new Thread(delegate()
		{
			int count = 0;
			while (true)
			{
				count = ++count > 10000 ? 0 : count;
			}
		});

		private void Form1_Load(object sender, EventArgs e)
		{
			this.cursor = Cursors.WaitCursor;
		}
	}
}
